package com.ww7h.mvvm

import android.os.Bundle
import android.view.LayoutInflater
import androidx.appcompat.app.AppCompatActivity
import androidx.databinding.ViewDataBinding

/**
 * ================================================
 * 描述：
 * 来源：     Android Studio.
 * 项目名：   bo-an-poj-common
 * 包名：     com.ww7h.mvvm
 * 创建时间：  2020/11/26 01:33
 * @author   ww
 * ================================================
 */
abstract class ViewActivity<VB : ViewDataBinding>: AppCompatActivity(), ViewCommon {

    protected lateinit var defaultDataBinding: VB

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        defaultDataBinding = getViewDataBinding(LayoutInflater.from(this), null, getContentViewLayoutId())
        setContentView(defaultDataBinding.root)
    }

    abstract fun getContentViewLayoutId():Int

}